package cn.wolfcode.trip.app.controller;


import cn.wolfcode.trip.base.domain.Reply;
import cn.wolfcode.trip.base.service.IReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/reply")
public class ReplyController {

    @Autowired
    private IReplyService replyService;

    @PostMapping
    public Object saveReply( String contentDetail, Long fromUserId,Long replyId, Long commentId){

                replyService.save(contentDetail,fromUserId,replyId,commentId);



        return  null;
    }


    @GetMapping("/{commentId}")
    public Object getReply( @PathVariable Long commentId){

       List<Reply> list= replyService.getReplysByCommentId(commentId);



        return  list;
    }


}
